﻿<%@ Page Language="C#" AutoEventWireup="true" ValidateRequest="false" CodeBehind="Comment.aspx.cs"
    Inherits="ZF.WS.Comment" %>

<%@ Register Src="/UserControls/vcodeimg.ascx" TagName="vcodeimg" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="/css/common.css" rel="stylesheet" type="text/css" />
    <link href="/css/default.css" rel="stylesheet" type="text/css" />

    <script src="/js/jQuery.js" type="text/javascript"></script>

    <script src="/js/jquery-1.4.2.js" type="text/javascript"></script>

    <script>
        $(function() {
            $(document.forms[0]).submit(function() {

                if ($(".tbContent").val() == "") {
                    alert("请输入内容");
                    return false;
                }
                if ($(".tbName").val() == "") {
                    alert("请输入名称");
                    return false;
                }
                if ($(".tbVCode").val() == "") {
                    alert("请输入验证码");
                    return false;
                }
            });

            window.top.window._commentHeightSet($(document).height());
        });
        
    </script>

    <style>
        * { margin: 0px; padding: 0px; font-size: 12px; list-style: none; font-family: 宋体,arial,verdana,sans-serif,fantasy,tahoma; }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <style>
            .comment { }
            .comment dl { border: 1px solid #eee; }
            .comment dt { height: 30px; line-height: 30px; border-bottom: 1px dashed #eee; }
            .comment dd { padding: 10px 30px; }
        </style>
        <div class="commentc" style="height: 200px; overflow: scroll;">
            <div class="comment">
                <zf:ListView runat="server" ID="lvList">
                    <LayoutTemplate>
                        <div style="">
                            <zf:PlaceHolder ID="itemPlaceHolder" runat="server">
                            </zf:PlaceHolder>
                        </div>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <dl>
                            <dt><span class="fl_  "><span class="zx_">&nbsp;&nbsp;&nbsp;&nbsp;网友</span>
                                <%#Eval("Name")%></span> <span class="fr_"><span class="zx_">Ip</span>
                                    <%#Eval("Ip")%>
                                    <span class="zx_">发表时间</span>
                                    <%#Eval("AddTime")%>&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:" class="yy">引用</a>&nbsp;&nbsp;<a
                                        href="javascript:" class="hf">回复&nbsp;&nbsp;&nbsp;&nbsp;</a></span></dt>
                            <dd>
                                <%#((string)Eval("Content")).EmptyString("").Replace("\r\n","</br>")%>
                            </dd>
                        </dl>
                    </ItemTemplate>
                </zf:ListView>
            </div>
        </div>

        <script>
            if ($(".comment").height() < $(".commentc").height()) {
                if ($(".comment").height() > 0) {
                    $(".commentc").height($(".comment").height() + 20)
                } else {
                    $(".commentc").height(0);
                }
            }
        </script>

        <script>
            $(".yy").click(function() {
                $(".tbContent").val(
                "引有内容:\r\n--------------------------------------------\r\n" +
                $(this.parentNode.parentNode.parentNode.parentNode).find("dd").html() +
                "\r\n--------------------------------------------\r\n");
            });
            $(".hf").click(function() {
                $(".tbContent").val(
                "\r\n--------------------------------------------\r\n" +
                $(this.parentNode.parentNode.parentNode.parentNode).find("dd").html() +
                "\r\n--------------------------------------------\r\n");
            });
        </script>

        <div>
            <table class="service w100_  edit edit1 " cellpadding="1" cellspacing="1">
                <tr>
                    <th colspan="2">
                        <span style="color: #000"><%=_Title %></span>
                    </th>
                </tr>
                <tr>
                    <td class="l">
                         内容：
                    </td>
                    <td class="r">
                        <div class="c">
                            <zf:TextBox runat="server" ID="tbContent" TextMode="MultiLine" class="mstxt" Style="width: 400px"></zf:TextBox>
                            <span class="zx_" id="Span1"></span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="l">
                        <span class=" xh_">*</span>名称：
                    </td>
                    <td class="r">
                        <div class="c">
                            <zf:TextBox runat="server" ID="tbName" class="stxt"></zf:TextBox>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="l">
                        <span class=" xh_">*</span>验证码：
                    </td>
                    <td class="r">
                        <div class="c">
                            <uc1:vcodeimg ID="vcodeimg1" runat="server" />
                        </div>
                    </td>
                </tr>
                <tr class="b">
                    <td colspan="2">
                        <zf:Button ID="btAdd" class="linkbtn addSubmit" OnClick="AddSubmit" runat="server"
                            Text=" 提 交 "></zf:Button>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    </form>
</body>
</html>
